local skel = fk.CreateSkill({
  name = "kpaI__qiqi",
  tags = { Skill.Family },
})

Fk:loadTranslationTable{
  ["kpaI__qiqi"] = "栖憩",
  [":kpaI__qiqi"] = "宗族技，限X次，你可以防止非同族角色对你造成的大于X点的伤害（X为你的手牌数）。",

  ["$kpaI__qiqi1"] = "凤栖梧桐，不为虫蚁所伤。",
  ["$kpaI__qiqi2"] = "食腐鼠之狸，安敢觊觎枝上之凤？",

}

skel:addEffect(fk.DamageInflicted,{
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(skel.name) and target == player
      and player:usedSkillTimes(skel.name,Player.HistoryGame) < #player:getCardIds("h")
      and data.damage > #player:getCardIds("h")
      and not string.find(Fk.generals[data.from.general].trueName,"pang",1)
  end,
  on_use = function (self, event, target, player, data)
    data:preventDamage()
  end,
})

return skel
